



package nc.bs.arap.backgroundtask;

import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.bs.pub.pa.PreAlertObject;
import nc.bs.pub.pa.PreAlertReturnType;
import nc.bs.pub.taskcenter.BgWorkingContext;
import nc.bs.pub.taskcenter.IBackgroundWorkPlugin;
import nc.itf.arap.hx.IHXBusiness;
import nc.itf.arap.informer.IInformerBusiness;
import nc.pub.batm.util.ExceptionUtils;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.MultiLangText;

public class InformerSychroAutoEt  implements IBackgroundWorkPlugin {
	@Override
	public PreAlertObject executeTask(BgWorkingContext bgwc)
			throws BusinessException { 
		MultiLangText text = new MultiLangText();
		PreAlertObject pao = new PreAlertObject();
		pao.setReturnType(PreAlertReturnType.RETURNNOTHING);
		pao.setReturnObj(text);
		bgwc.setLogStr(null); 
		String userid_Bak = InvocationInfoProxy.getInstance().getUserId();
		try { 
			String log = NCLocator.getInstance().lookup(IInformerBusiness.class).Informer();
			bgwc.setLogStr(log);
		} catch (Exception e) {
			e.printStackTrace();
			if(e instanceof BusinessException){
				throw new BusinessException(e.getMessage());
			}else{
				throw new BusinessException(ExceptionUtils.getStackTrace(e));
			}
		}
		InvocationInfoProxy.getInstance().setUserId(userid_Bak);
		return pao;
	}
}